/*package com.mymaxis.service;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;
import java.util.Vector;

import com.checkfree.isolutions.customer.persist.Account;
import com.checkfree.isolutions.customer.persist.AccountHomeImpl;
import com.checkfree.isolutions.customer.persist.Merchant;
import com.checkfree.isolutions.customer.persist.MerchantHomeImpl;
import com.checkfree.isolutions.persist.PersistServer;
import com.checkfree.isolutions.statement.persist.StatementHomeImpl;
import com.checkfree.isolutions.statement.persist.Statement;
import com.mymaxis.dao.AccDao;


public class GetListOfBill_WS {
	
	public ArrayList getListOfBill(AccDao accountDao) {
		ArrayList listOfBill = new ArrayList();
	//	String strAccNo = accountDao.getAccNo();//accountDao.getAccNo();
		//if(strAccNo != null || !strAccNo.equals("")){
		//	Account account = AccountHomeImpl.singleton().findByExternalKeyAndMerchant(strAccNo, cfiMerchant);
		//}
		PersistServer.activate("Maxis");
		PersistServer.beginTransaction();
		try{
			
			Merchant cfiMerchant = MerchantHomeImpl.singleton().findByName("maxis");
	//		Account account = AccountHomeImpl.singleton().findByExternalKeyAndMerchant(strAccNo, cfiMerchant);

			TimeZone tz = TimeZone.getTimeZone("GMT+8:00");
	        Calendar cal = Calendar.getInstance(tz);
	        Date endDate = cal.getTime();
	        //Get the start Date
	        cal.add(Calendar.MONTH, -6);
	        cal.set(Calendar.DATE, 1);
	        cal.set(Calendar.HOUR_OF_DAY, 0);
	        cal.set(Calendar.MINUTE, 0);
	        cal.set(Calendar.SECOND, 0);
	        cal.set(Calendar.MILLISECOND, 0);
	        Date startDate = cal.getTime();
			//Sytem.out.println(startDate.toString());
            Vector cfiStatements =  StatementHomeImpl.singleton().findByAccount(account, startDate, endDate);
			//Sytem.out.println(cfiStatements.size());
			for(int i =0; i<cfiStatements.size();i++){
				String listOfBillDetails = "";
				Statement statement = (Statement)cfiStatements.get(i);
				////Sytem.out.println(statement.getInstanceId());
				////Sytem.out.println(account.getExternalKey());
				String formattedDate = new SimpleDateFormat("dd-MM-yy").format(statement.getDate());
				//Sytem.out.println(formattedDate);
				listOfBillDetails = account.getExternalKey()+","+statement.getInstanceId()+","+formattedDate;
				listOfBill.add(listOfBillDetails);
			}
			
			PersistServer.commitTransaction();
		}catch(Exception e) {
			e.printStackTrace();
			
		} catch (Throwable t) {
			t.printStackTrace();
		}finally {
			if (PersistServer.transactionIsActive()){
				try {
					PersistServer.rollbackTransaction();
				}catch (Exception e) {
				}
			}
			PersistServer.deactivate(); //clean up with deactivate
		}
		return listOfBill;
	}
	
	public static void main(String[] args){
		GetListOfBill_WS ws = new GetListOfBill_WS();
		AccDao accDao = new AccDao();
		accDao.setAccNo("805046166");
		ws.getListOfBill(accDao);
		//Sytem.out.println("Test");
		
	}
}
*/